-module(pst_core).
-export([start/1, service/3]).

 
service(SessionID, _Env, _Input) ->
 io:format("ok~n"),
 mod_esi:deliver(SessionID, [
  "Content-Type: text/html\r\n\r\n", 
  "<html><body>Hello, World!</body></html>"
 ]).

start(Args)->
% register(pst_child,spawn(pst_core, , [])),
 io:format("***** Yeah! pst_core has started! ******"),
 inets:start(),
 inets:start(httpd, [
  {modules, [
   mod_alias, 
   mod_auth, 
   mod_esi, 
   mod_actions, 
   mod_cgi, 
   mod_dir, 
   mod_get, 
   mod_head, 
   mod_log, 
   mod_disk_log
  ]},
  {port,80},
  {server_name,"pst_core!"},
  {server_root,"logs"},
  {document_root,"www"},
  {erl_script_alias, {"/erl", [pst_core]}},
  {error_log, "core_error.log"},
  {security_log, "core_security.log"},
  {transfer_log, "core_transfer.log"},
  {mime_types,[
   {"html","text/html"},
   {"css","text/css"},
   {"js","application/x-javascript"}
  ]}
 ]).
